package main

import "fmt"

func main() {
	var a = "世界hello,"
	//b := a[0:4]
	//c := a[1:]
	//d := a[:4]
	b := []byte(a)
	c := []rune(a)
	fmt.Println(b, c)
	fmt.Println(Str(a, 2))
}

func Str(str string, length int) string {
	var i,n int
	for i = range str {
		if length == n {
			break
		}
		n++
	}
	return str[:i]
}